<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta content="" name="description" />
    <meta content="webthemez" name="author" />
    <title>忘记密码</title>
    <!-- Bootstrap Styles-->
    <link href="assets/css/bootstrap.css" rel="stylesheet" />
    <!-- FontAwesome Styles-->
    <link href="assets/css/font-awesome.css" rel="stylesheet" />

    <link href="assets/css/select2.min.css" rel="stylesheet" >
    <link href="assets/css/checkbox3.min.css" rel="stylesheet" >
    <!-- Custom Styles-->
    <link href="assets/css/custom-styles.css" rel="stylesheet" />
    <!-- Google Fonts-->
    <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
</head>
<body>
<div id="page-wrapper" >
    <div class="header">
        <h1 class="page-header">
            忘记密码 <small>重置密码</small>
        </h1>
    </div>

    <div id="page-inner">


        <div class="row">
            <div class="col-xs-12">
                <div class="panel panel-default">
                    <div class="panel-body">
                        <form class="form-horizontal" id="form">
                            <div class="form-group">
                                <label  class="col-sm-2 control-label">用户名</label>
                                <div class="col-sm-10">
                                    <input type="username" class="form-control" id="username" placeholder="邮箱" width="30px">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><span style="color:red">*</span>验证邮箱</label>
                                <div class="col-sm-10">
                                    <input type="email" class="form-control" id="email" placeholder="邮箱" width="30px">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-10">
                                    <input type="button" class="btn btn-default" onclick="checkuser()" value="重置">
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>


    </div>
    <!-- /. PAGE INNER  -->
</div>
<!-- /. PAGE WRAPPER  -->
</div>
<!-- /. WRAPPER  -->
<!-- JS Scripts-->
<!-- jQuery Js -->
<script src="assets/js/jquery-1.10.2.js"></script>
<!-- Bootstrap Js -->
<script src="assets/js/bootstrap.min.js"></script>
<!-- Metis Menu Js -->
<script src="assets/js/jquery.metisMenu.js"></script>
<script src="assets/js/select2.full.min.js"></script>

<!-- Custom Js -->
<!--<script src="assets/js/custom-scripts.js"></script>-->
<script src="assets/js/util.js"></script>
<script>
    function checkuser() {
      var username=document.getElementById("username").value;
      var email=document.getElementById("email").value;
      var re=getResponse('/user/checkuser',JSON.stringify({"username":username,"email":email}));
      console.log(re);
        if(re.responseJSON!=null&&re.responseJSON!=''){
            var res=getResponse('/user/resetPwd/'+username);
            if(res!=null)
                alert("修改完成！请在邮箱查收");
        }
        else{
            alert("请核实邮箱与学号信息");
        }
    }

</script>


</body>
</html>
